package com.gitee.wsl.common.ui.base


/***
 * 每个点的控制，关心三个因素：笔的宽度，坐标,透明数值
 *
 * @since 2018/06/15
 * @author king
 */
 class ControlPoint(
    var x:Float = 0f,
    var y:Float = 0f,
    var width:Float = 0f,
    var alpha:Int = 255
){
    constructor(
        point: Point,
        width: Float = 0f,
        alpha:Int = 255
    ) : this(point.x,point.y,width,alpha)

    operator fun set(x: Float, y: Float, w: Float) {
        this.x = x
        this.y = y
        width = w
    }

    operator fun set(point: Point, w: Float) {
        this.x = point.x
        this.y = point.y
        width = w
    }

    fun set(point: ControlPoint) {
        x = point.x
        y = point.y
        width = point.width
    }

    fun getPoint() = Point(x,y)
}